package fakeSmarthouseHW;

import java.util.Hashtable;
import java.util.LinkedList;

import devices.Heater;

public class FakeHeater  extends FakeDevice{
	public boolean state = true;
	public int maxTemperature=10;
	public int desiredTemperature=110;
	public boolean economic=false;	
	
	
	
	public FakeHeater(int id) {
		super(id);
	}
	
	@Override
	public void execCommand(int deviceId, int commandId,
			LinkedList<Object> params) {
		
		System.out.println("FH: message for "+deviceId+" and i am "+id);
		
		if (deviceId!=id) return;
		switch (commandId){
			case 0: state = (Boolean) params.get(0); return;
			case 1: maxTemperature = (Integer) params.get(0);
					desiredTemperature = (Integer) params.get(1);
					economic = (Boolean) params.get(2);
					return;
		}
		
	}
	
	@Override
	public LinkedList<Object> getData() {

		LinkedList<Object> data = new LinkedList<Object>();
		data.add(state);
		data.add(maxTemperature);
		data.add(desiredTemperature);
		data.add(economic);
		
		return data;
	}
	

}
